1. Field of the Invention
The present invention relates to an image compressor which compresses a multi-gradation image.
2. Description of the Related Art
Recently, a quantity of image data to be processed has greatly increased because the image becomes colored and multi-gradational. This has caused a data compressing method to be studied extensively which includes encoding in order to reduce the quantity of image data. There are many compressing methods which restore the image correctly to its original image after the compression due to the image encoding and so forth. However, a compressing method in which there is no problem even if the image is not restored correctly its original image has not greatly been studied.
In the conventional image compressor, a block approximate encoding method is performed in which each of the xe2x80x9cRxe2x80x9d, xe2x80x9cGxe2x80x9d and xe2x80x9cBxe2x80x9d multi-gradational images is divided into a plurality of pixel blocks of adjacent pixels, which are then represented by two typical values and a block pattern produced by a binarizing process to thereby perform the image compression.
The block approximate encoding method performed in the conventional image compressor will be described with reference to FIGS. 31-33. FIG. 30 is a block diagram of the conventional image compressor. In FIG. 30, reference numeral 121 denotes the image compressor; 122 an image block-dividing unit; 123 a plane threshold value determining unit; and 124 a plane binarizing unit. FIG. 31A is a data diagram showing the block data of xe2x80x9cRxe2x80x9d, FIG. 31B is a data diagram showing the block data of xe2x80x9cGxe2x80x9d, and FIG. 31C is a data diagram showing the block data of xe2x80x9cBxe2x80x9d. FIG. 32A is a data diagram showing the binarized data of xe2x80x9cRxe2x80x9d, FIG. 32B is a data diagram showing the binarized data of xe2x80x9cGxe2x80x9d, FIG. 32C is a data diagram showing the binarized data of xe2x80x9cBxe2x80x9d, and FIG. 33 is a data composition diagram showing the compressed data according to the approximate encoding process in the conventional image compressor.
Each of the xe2x80x9cRxe2x80x9d, xe2x80x9cGxe2x80x9d and xe2x80x9cBxe2x80x9d input image data is divided by the image block-dividing unit 122 into the image blocks each of which includes a plurality of adjacent pixels. The plane threshold value determining unit 123 obtains the average value of each of the block planes for the xe2x80x9cRxe2x80x9d, xe2x80x9cGxe2x80x9d and xe2x80x9cBxe2x80x9d image block data block-divided by the image block block-dividing unit 122. The average value is used as a threshold value of each block plane. The image data in each block is compared with the threshold value of the block plane. The data performed the binarizing process on the basis of the result of the comparison, and two typical values, which comprises the average value of the original image data at the positions where the comparison results are larger and the average value of the original image data at the positions where the comparison results are smaller, are output as the compressed image data.
More specifically, FIGS. 31A-31C illustrate one example of the data for the respective block planes block-divided by the image block-dividing unit 122, and show the xe2x80x9cRxe2x80x9d plane block data 126, the xe2x80x9cGxe2x80x9d plane block data 127 and the xe2x80x9cBxe2x80x9d plane block data 128, respectively. In this example, the image data is divided into blocks of 4xc3x974 adjacent pixels. Reference numeral 125 denotes one pixel, and the inner numerical value represents the 8-bits luminance data.
At this time, the plane threshold value determining unit 123 calculates the average value of the luminance data in each block for each of the plane block data 126-128 to produce the threshold value of each block. That is, the respective threshold values of the plane block data 126-128 shown in FIGS. 31A-31C are xe2x80x9c47xe2x80x9d, xe2x80x9c9xe2x80x9d and xe2x80x9c9xe2x80x9d, respectively. FIGS. 32A-32C show the results of performing the binarizing process using the threshold values in the plane binarizing unit 124. The results are the xe2x80x9cRxe2x80x9d plane binarized data 129, the xe2x80x9cGxe2x80x9d plane binarized data 130 and the xe2x80x9cBxe2x80x9d plane binarized data 131, respectively.
In FIG. 32A, the average value xe2x80x9c89xe2x80x9d (xe2x80x9c59xe2x80x9d in hexadecimal notation) of the luminance data of the pixels shown in FIG. 31A corresponding to the pixels of data xe2x80x9c1xe2x80x9d is handled a s the higher-luminance typical value. Similarly, in FIG. 32A, the average value xe2x80x9c5xe2x80x9d (xe2x80x9c05xe2x80x9d in hexadecimal notation) of the luminance data of the pixels shown in FIG. 31A corresponding to the pixels of data xe2x80x9c0xe2x80x9d is handled as the lower-luminance typical value. These apply to the pixels shown in FIGS. 32B and 32C.
Based on the above calculations, the typical values of the respective planes are represented as the xe2x80x9cRxe2x80x9d typical values xe2x80x9c89xe2x80x9d (0xc3x9759) and xe2x80x9c5xe2x80x9d (0xc3x9705), the xe2x80x9cGxe2x80x9d typical values xe2x80x9c15xe2x80x9d (0xc3x970F) and xe2x80x9c3xe2x80x9d (0xc3x9703) and the xe2x80x9cBxe2x80x9d typical values xe2x80x9c15xe2x80x9d (0xc3x970F) and xe2x80x9c3xe2x80x9d (0xc3x9703) in order of the higher-luminance typical value and the lower-luminance typical value. Each numerical value represents the 8-bit luminance value in the decimal notation, and the bracketed numerical value represents one in the corresponding hexadecimal notation. The notation with xe2x80x9c0xc3x97xe2x80x9d represents one in the hexadecimal notation. When the decimal number is set down with the hexadecimal number, the similar notations are used.
These data are encoded to obtain the data shown in FIG. 33. Reference numeral 132 represents the compressed data obtained according to the block approximate encoding method mentioned above. Reference numerals 133, 136 and 139 show the respective positions of the xe2x80x9cRxe2x80x9d, xe2x80x9cGxe2x80x9d and xe2x80x9cBxe2x80x9d binarized block data. Reference numerals 134, 137 and 140 represent the respective positions of the xe2x80x9cRxe2x80x9d, xe2x80x9cGxe2x80x9d and xe2x80x9cBxe2x80x9d higher-luminance typical values. Reference numerals 135, 138 and 141 represent the respective positions of the xe2x80x9cRxe2x80x9d, xe2x80x9cGxe2x80x9d and xe2x80x9cBxe2x80x9d lower-luminance typical values. The binarized block data represents the array in which the binarized block data shown in FIG. 32 are arranged from left to right in row and from up to down in column (in FIG. 32A, xe2x80x9c0001000101110111xe2x80x9d) in the hexadecimal notation (in FIG. 32A, xe2x80x9c1171xe2x80x9d).
In the block approximate encoding method performed in the conventional image compressor, however, no binarized data is compressed and each plane has the binarized data. Thus, there is room to improve the compression rate by gathering the binarized data.
It is an object of the present invention to provide an image compressor which can improve the image compression rate by commonizing the binarized data of the luminance and chrominance data of the image, and can further improve the image compression rate by using the dictionaries represented in the number of the combinations less than the number of all possible combinations of the binarized data.
In order to achieve the above object, an image compressor according to the present invention comprises: a color space converting unit for separating an input image data into a luminance data and a chrominance data; an image block-dividing unit for block-dividing the luminance and chrominance data separated by the color space converting unit, using a plurality of adjacent pixels; a luminance threshold value determining unit for determining a threshold value with which a binarization of the luminance data block-divided in the image block-dividing unit is performed; a luminance binarizing unit for binarizing the block-divided luminance data using the threshold value determined by the luminance threshold value determining unit; a typical value forming unit for forming two typical values of the block-divided luminance and chrominance data in accordance with the luminance data binarized by the luminance binarizing unit; and a binarized luminance compressing unit for encoding the binarized luminance data using dictionaries whose number is smaller than the number of all combinations of the luminance data binarized by the luminance binarizing unit.
Thus, the image compressor is provided in which the image compression rate can be improved by commonizing the binarized data of the luminance and chrominance data of the image, and can be further improved by the dictionaries represented in the number of the combinations less than the number of all possible combinations of the binarized data.